package com.kfm.movie;

import com.kfm.util.List;

public class StudentTest {

    private List students = new List();

    public List getStudents() {
        return students;
    }

    public void addStudent(Student student) {
        students.add(student);
    }

    // static 方法中调用实例方法 创建对象
    public static void main(String[] args) {

        StudentTest st = new StudentTest();
        Student stu = new Student("张三", 23);
        Student stu1 = new Student("李四", 21);
        Student stu2 = new Student("王五", 22);
        Student stu3 = new Student("孙六", 20);
        st.addStudent(stu);
        st.addStudent(stu1);
        st.addStudent(stu2);
        st.addStudent(stu3);

        System.out.println(st.getStudents());
        System.out.println(st.getStudents().size());

        System.out.println(st.getStudents().remove(1));

        System.out.println(st.getStudents().remove(stu2));

        System.out.println(st.getStudents().get(0));

        System.out.println(st.getStudents().size());

    }
}
